﻿<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="keywords" content="@ViewBag.Profile.Name,Blog,Admin" />
    <meta name="description" content="@ViewBag.Profile.Name | Admin" />

    <meta property="og:locale" content="zh_cn" />
    <meta property="og:type" content="article" />
    <meta property="og:title" content="@ViewBag.Profile.Name" />
    <meta property="og:description" content="@ViewBag.Profile.Name | Admin" />
    <meta property="og:site_name" content="@ViewBag.Profile.Name" />
    <meta property="og:image" content="@OssService.GetAvatar()" />

    <title>@ViewBag.PageTitle | Admin</title>

    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="~/lib/open-iconic/font/css/open-iconic-bootstrap.min.css" />
    <link rel="stylesheet" href="~/css/shared/_layout.min.css" />

    <script src="~/lib/jquery/dist/jquery.min.js"></script>
    <script src="~/lib/bootstrap/dist/js/bootstrap.min.js"></script>

    @switch (ViewBag.Theme.ThemeType)
    {
        case ThemeType.Auto:
            @if (DateTime.Now.Hour > 18 || DateTime.Now.Hour < 7)
            {
                <script type="text/javascript" src="~/lib/darkreader/darkreader.min.js"></script>
                <script>DarkReader.setFetchMethod(window.fetch); DarkReader.enable();</script>
            }
            break;

        case ThemeType.White:
            break;

        case ThemeType.Black:
            <script type="text/javascript" src="~/lib/darkreader/darkreader.min.js"></script>
            <script>DarkReader.setFetchMethod(window.fetch); DarkReader.enable();</script>
            break;
    }

</head>
<body>
    <app>
        <div class="sidebar">

            <div class="top-row pl-4 navbar navbar-light bg-light ">
                <a class="navbar-brand" asp-controller="Overview" asp-action="Index">Admin | @ViewBag.Profile.Name</a>
                <button class="navbar-toggler" data-toggle="collapse" data-target="#navbar">
                    <span class="navbar-toggler-icon"></span>
                </button>
            </div>

            <div class="collapse navbar-collapse" id="navbar">
                <ul class="nav flex-column">
                    @if(ViewBag.NotificationCount > 0)
                    {
                        <li class="nav-item px-3">
                            <a class="nav-link bg-primary text-white" asp-controller="Notification" asp-action="Index">
                                <span class="oi oi-bell"></span> Notification &nbsp;&nbsp;
                                <span class="badge badge-secondary">@ViewBag.NotificationCount</span>
                            </a>
                        </li>
                    }
                    <li class="nav-item px-3">
                        <a class="nav-link" asp-controller="Overview" asp-action="Index">
                            <span class="oi oi-home"></span> Overview
                        </a>
                    </li>
                    <li class="nav-item px-3">
                        <a class="nav-link" asp-controller="Profile" asp-action="Index">
                            <span class="oi oi-person"></span> Profile
                        </a>
                    </li>
                    <li class="nav-item px-3">
                        <a class="nav-link" asp-controller="Project" asp-action="Index">
                            <span class="oi oi-project"></span> Project
                        </a>
                    </li>
                    <li class="nav-item px-3">
                        <a class="nav-link" asp-controller="Theme" asp-action="Index">
                            <span class="oi oi-sun"></span> Theme
                        </a>
                    </li>
                    <li class="nav-item px-3">
                        <a class="nav-link" asp-controller="Blog" asp-action="Index">
                            <span class="oi oi-script"></span> Blog
                        </a>
                    </li>
                    <li class="nav-item px-3">
                        <a class="nav-link" href="https://oss.console.aliyun.com/bucket" target="_blank">
                            <span class="oi oi-cloud"></span> OSS
                        </a>
                    </li>
                    <li class="nav-item px-3">
                        <a class="nav-link" asp-controller="Home" asp-action="Logout">
                            <span class="oi oi-account-logout"></span> Exit
                        </a>
                    </li>
                </ul>
            </div>

        </div>

        <div class="main">
            @RenderBody()
        </div>

    </app>
</body>
</html>
